package com.atguigu.scala.chapter7

/**
 * @author lizikuan
 * @date 2021/5/24 14:03
 */
object $07_CollectionFunction {
  def main(args: Array[String]): Unit = {
    val list1 = List("hello map","hello spark","hello zk kafka","zk kafka")
    val list3 = list1.flatMap(_.split(" "))
    val list4 = list1.groupBy(_.split(" ")(0))
    val list5 = list4.map(x => x._1 -> x._2.size)
    println(list5)
  }
}
